package com.hwj.service.Impl;

import com.hwj.entity.Notify;
import com.hwj.mapper.NotifyMapper;
import com.hwj.service.NotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NotifyServiceImpl implements NotifyService {
    @Autowired
    private NotifyMapper notifyMapper;

    @Override
    public Long getCount(Long userId) {
        Notify notify = new Notify();
        notify.setUserId(userId);
        notify.setStatus(0);
        long count = notifyMapper.selectAll(notify).stream().count();
        return count;
    }

    @Override
    public List<Notify> listNotify(Long id) {
        Notify notify = new Notify();
        notify.setUserId(id);
        return notifyMapper.selectAll(notify);
    }
}
